package com.tllq.zhongkang.controller;

import com.tllq.zhongkang.entity.Goods;
import com.tllq.zhongkang.entity.ResultMap;
import com.tllq.zhongkang.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class GoodsController {

    @Autowired
    GoodsService goodsService;

    @GetMapping("/product")
    public ResultMap findAll(){
        List<Goods> goods = goodsService.findAll();
        return ResultMap.ok(goods);
    }

}
